#include <bits/stdc++.h>
#ifdef dbg
#define D(...) fprintf(stderr, __VA_ARGS__)
#define DD(...) D(#__VA_ARGS__ " = "), debug_helper::debug(__VA_ARGS__), D("\n")
#include "C:\Users\wsyear\Desktop\OI\templates\debug.hpp"
#else
#define D(...) ((void)0)
#define DD(...) ((void)0)
#endif
#define rep(i, j, k) for (int i = (j); i <= (k); ++i)
#define per(i, j, k) for (int i = (j); i >= (k); --i)
#define SZ(v) int((v).size())
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
using ll = long long;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

const int N = 510;
const double inf = 1e30;

struct node {
  ll a, b;
} a[N];

int n, m, k;
ll b[N], sum[N];
double f[N][N];

int main() {
  freopen("talk.in", "r", stdin);
  freopen("talk.out", "w", stdout);
  cin.tie(nullptr) -> ios::sync_with_stdio(false);
  cin >> n >> k;
  rep (i, 1, n) cin >> a[i].a >> a[i].b;
  rep (i, 1, n) if (a[i].b == -1) a[i].b = 1e9;
  sort(a + 1, a + n + 1, [&](node x, node y) { return x.b < y.b; });
  double ans = 0;
  rep (i, 1, n) b[i] = a[i].a;
  sort(b + 1, b + n + 1);
  rep (i, 1, k) ans += b[i];
  rep (p, 0, n) {
    rep (i, 0, n) rep (j, 0, n) f[i][j] = inf;
    f[0][0] = 0;
    rep (i, 1, n) {
      rep (j, 0, n) f[i][j] = f[i - 1][j] + 1. * a[i].a / (p + 1);
      rep (j, 0, n - 1) f[i][j + 1] = min(f[i][j + 1], f[i - 1][j] + 1. * a[i].b / (j + 1));
      m = 0;
      rep (j, i + 1, n) b[++m] = a[j].a;
      sort(b + 1, b + m + 1);
      rep (j, 1, m) sum[j] = sum[j - 1] + b[j];
      rep (j, p, p) if (k - i <= m) ans = min(ans, f[i][j] + 1. * sum[max(0, k - i)] / (p + 1));
    }
  }
  cout << fixed << setprecision(9) << ans << '\n';
}